package com.ff.discounts.component.freedetail

import android.content.Context
import android.view.ViewGroup
import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.QuickViewHolder
import com.ff.discounts.R
import com.ff.discounts.component.tab.home.HistoryData

/**
 * 限时秒杀的adapter
 * @author: fufang
 * @date: 2023/10/30
 */
class FreeGoodsAdapter  : BaseQuickAdapter<HistoryData, QuickViewHolder>() {
    override fun onBindViewHolder(holder: QuickViewHolder, position: Int, data: HistoryData?) {
        data?.let {
            holder.setText(R.id.name,"第一百集")
            val iconView = holder.getView<ImageView>(R.id.play_photo)
            iconView.setImageResource(data.src as Int)
        }
    }

    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): QuickViewHolder {
        return QuickViewHolder(R.layout.item_skill_goods,parent)
    }
}